package com.cloud.drore.eboss.operation.controller;

import com.cloud.drore.eboos.common.base.PagePo;
import com.cloud.drore.eboos.common.base.ResultMessage;
import com.cloud.drore.eboos.common.entity.dealer.OperationTicketOrderVo;
import com.cloud.drore.eboos.common.entity.dealer.OrderDetailVo;
import com.cloud.drore.eboos.common.entity.dealer.OrderInitVo;
import com.cloud.drore.eboos.common.entity.dealer.OrderQueryPo;
import com.cloud.drore.eboos.exception.BusinessException;
import com.cloud.drore.eboss.operation.entity.OTASendOrderEticketRequest;
import com.cloud.drore.eboss.operation.entity.OTASendOrderEticketResponse;
import com.cloud.drore.eboss.supplier.service.ITicketOrderFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.sql.ResultSet;
import java.util.List;

/**
 * 浙江卓锐科技股份有限公司 版权所有  Copyright 2018<br>
 *
 * @Description: 运营商门票订单Controller<br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/2/9 17:08 <br>
 * @Author: <a href="747639122@qq.com">冯腾</a>
 */
@RestController
@RequestMapping("/operationTicketOrder")
@Api(value = "运营商-订单管理-门票订单接口" , description = "运营商-订单管理-门票订单接口-冯腾")
public class OperationTicketOrderController {

    public ResultSet get(ResultSet resultSet){
        return null;
    }

    @Autowired
    ITicketOrderFeign ticketOrderFeign;

    @ApiOperation(value = "运营商模块门票条件查询")
    @PostMapping(value = "operationQueryTickets")
    public ResultMessage<List<OperationTicketOrderVo>> operationQueryTickets(@RequestBody PagePo<OrderQueryPo> pagePo) throws BusinessException {
        return ticketOrderFeign.operationQueryTickets(pagePo);
    }

    @ApiOperation(value = "运营商通过id获取门票订单详情")
    @GetMapping(value = "getTicketOrderDetail/{id}")
    public ResultMessage<OrderDetailVo> getTicketOrderDetail(@PathVariable("id") Long id) throws BusinessException {
        return  ticketOrderFeign.getTicketOrderDetail(id);
    }

    @ApiOperation(value = "运营商门票订单页面加载初始化数据")
    @GetMapping(value = "/init")
    public ResultMessage<OrderInitVo> init() {
        return ticketOrderFeign.operationInit();
    }

    @ApiOperation(value = "运营商下所有满足条件的订单发送短信接口！")
    @PostMapping(value = "/sendOrderEticket")
    public ResultMessage<OTASendOrderEticketResponse> sendOrderEticket(@RequestBody OTASendOrderEticketRequest otaSendOrderEticketRequest){
        return ticketOrderFeign.sendOrderEticket(otaSendOrderEticketRequest);
    }


}
